﻿using System;
using System.Windows;
using SilverMindMap.Core.Model;

namespace SilverMindMap.Core.View
{
    public interface INodeSizeProvider
    {
        Size GetNodeSize(Node node);
        event EventHandler<EventArgs> NodesSizesInvalidated;
        event EventHandler<NodeSizeChangedEventArgs> NodeSizeChanged;
    }

    public sealed class NodeSizeChangedEventArgs : EventArgs
    {
        private readonly Node _node;
        private readonly Size _newSize;

        public NodeSizeChangedEventArgs(Node node, Size newSize)
        {
            Guard.ArgumentNotNull(node, "node");
            _node = node;
            _newSize = newSize;
        }

        public Node Node
        {
            get { return _node; }
        }

        public Size NewSize
        {
            get { return _newSize; }
        }
    }
}
